package com.jeebey.mybatis.dialect;

/**
 * @since 1.0
 * @author <a href="mailto:84961426@qq.com">JuST4iT</a>
 * @version $Id: Dialect.java Feb 18, 2016 6:01:59 PM $
 */
public enum Dialect {
    mysql, mariadb, sqlite, oracle, hsql, postgresql, sqlserver, db2, informix, h2, sqlserver2012;
    public static Dialect of(String dialect) {
        try {
            return Dialect.valueOf(dialect.toLowerCase());
        } catch (IllegalArgumentException e) {
            String dialects = "";
            for (Dialect d : Dialect.values()) {
            	dialects += "," + d;
            }
            throw new IllegalArgumentException("Mybatis分页插件dialect参数值错误，可选值为[" + dialects.substring(1) + "]");
        }
    }
}